home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
A-Monthly Disks
/
(c)aak.d64
/
course update
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
5KB
|
220 lines
10 REM COURSE UPDATE
20 REM AL JOHNSON
25 REM 12302 COLERAINE CT
30 REM RESTON, VA 22091
35 REM SEND ME A CARD IF YOU LIKE IT OR
40 REM IF YOU HAVE SUGGESTIONS.
100 POKE53280,11:POKE53281,15
110 GOSUB8000
120 DIM CR$(20,23),CU(23,3),EN$(20)
130 UN$="[164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]"
140 FORX=1TO23:READA,B,C:CU(X,1)=A:CU(X,2)=B:CU(X,3)=C:NEXTX
150 FORX=828 TO 828+10 :READA:POKEX,A:NEXTX
190 IFF$="[140]" THEN 4000
192 IF F$<>"[139]" THEN 200
194 OPEN15,8,15,"I0"
195 OPEN5,8,5,"0:GLF CRS-BK,S,R":GOSUB9600:GOTO220
200 OPEN15,8,15,"I0"
210 OPEN5,8,5,"0:GLF COURSE,S,R":GOSUB9600
220 IF EN=61OREN=62THENGOSUB2100:PRINT"NEW FILE[151]":GOTO265
230 INPUT#5,RC
240 FORX=1TORC
250 FORY=1TO23:INPUT#5,CR$(X,Y):NEXTY
260 NEXTX
265 CLOSE5:CLOSE15
270 GOTO4000
399 REM SAVE SUBR
400 GOSUB2100:PRINT"O.K. SAVING"
407 OPEN15,8,15,"I0"
410 OPEN6,8,6,"@:GLF COURSE,S,W":GOSUB9600
420 PRINT#6,RC
430 FORX=1TORC
440 FORY=1TO23:PRINT#6,CR$(X,Y)
446 NEXTY
450 NEXTX:SV$="Y"
470 CLOSE6:CLOSE15:GOSUB2100
480 OM$="SAVE COMPLETE "+STR$(RC)+" COURSES":PRINTOM$
490 RETURN
599 REM BACKUP SUBR
600 POKE850,21:POKE851,7:SYS828
610 PRINT"INSERT BACKUP DISK - HIT A KEY[151]"
620 GOSUB9200
630 SYS828
640 PRINT" "
650 OPEN15,8,15,"I0"
660 OPEN6,8,6,"@0:GLF CRS-BK,S,W":GOSUB9600
663 IFEN<>0THENGOSUB2100:PRINT"DISK ERROR - "+EM$:CLOSE6:CLOSE15:RETURN
670 GOSUB420:GOSUB2100
680 OM$="BKUP COMPLETE -- CHANGE DISKS"
690 PRINTOM$:RETURN
799 REM *** INSERT UNDERLINES FOR ADD
800 CR$(CP,1)=LEFT$(UN$,20)
810 CR$(CP,2)=LEFT$(UN$,2)
820 CR$(CP,3)=LEFT$(UN$,4)
830 CR$(CP,4)=LEFT$(UN$,4)
835 CR$(CP,23)=LEFT$(UN$,5)
840 FORX=5TO22:CR$(CP,X)=LEFT$(UN$,1)
850 NEXTX
860 RETURN
995 REM *** DRAW BLANK SCREEN
1000 PRINT"[147][151]";TAB(11);"PERSONAL GOLF HANDICAP"
1010 PRINT"";TAB(16);"COURSE DATA"
1020 PRINT"[152]";TAB(8)"COURSE"
1030 PRINT" PAR";TAB(11);"RATING";TAB(25);"DISTANCE"
1040 FORX=1TO7STEP3
1050 TM=0
1055 PRINT" ";
1060 FORY=XTOX+2
1070 PRINT"HOLE ";RIGHT$(STR$(Y),2);
1090 TM=TM+1:IFTM<3THEN PRINTSPC(6);
1100 NEXTY:PRINT:NEXTX:TM=0
1110 FORX=10 TO 16 STEP 3
1120 PRINT"";:TM=0
1130 FORY=XTOX+2
1140 PRINT"HOLE ";RIGHT$(STR$(Y),2);
1150 TM=TM+1:IFTM<3 THEN PRINTSPC(6);
1160 NEXTY:PRINT:NEXTX
1170 PRINTTAB(6);"COURSE NAME ABBRV"
1190 PRINT"[151]A[152]DD [151]N[152]EXT [151]B[152]ACK [151]C[152]HG [151]Q[152]UIT [151]S[152]AVE B[151]K[152]UP"
1200 RETURN
1395 REM ** FILL SCREEN WITH DATA
1400 PRINT"[151] #";STR$(CP):PRINT"OF "STR$(RC)
1405 POKE850,CU(1,1):POKE851,CU(1,2):SYS828
1406 PRINT" "
1408 FORX=1TO23
1410 POKE850,CU(X,1):POKE851,CU(X,2):SYS828
1420 PRINT"[151]"CR$(CP,X)
1430 NEXTX
1440 RETURN
1595 REM **** MASS ENTRY ROUTINE
1600 TP=0:FORFP=1TO23
1610 POKE850,CU(FP,1):POKE851,CU(FP,2):SYS828
1620 PRINT"?[157][151]";
1630 GOSUB1800
1633 IFFP>4ANDFP<23THENTP=TP+VAL(AN$)
1640 CR$(CP,FP)=AN$
1650 NEXT FP
1655 IFTP=VAL(CR$(CP,2))THEN1660
1658 GOSUB2100:PRINT"WARN-HOLES <> PAR - HOLES TOT";TP:FC=FC+1:RETURN
1660 GOSUB2100:PRINT"ENTRY COMPLETE[151]":FC=FC+1
1670 RETURN
1795 REM *** RTN TO DO GETS FOR ENTRY
1800 FORX=1TO20:EN$(X)="":NEXTX:C=0:AN$=""
1810 GETK$:IFK$="" THEN 1810
1820 IF K$=CHR$(20) THEN 1810
1825 IF K$=CHR$(13)ANDC=0THEN1810
1830 IF K$=CHR$(13) ANDC>1THEN 1910
1840 IF K$="[133]" THEN 1880
1850 C=C+1:EN$(C)=K$:PRINTK$;
1860 IF C<CU(FP,3) THEN 1810
1870 GOTO1910
1880 IF C-1 < 0 THEN 1810
1890 C=C-1:EN$(C)="":PRINT"[157] [157]";
1900 GOTO1810
1910 FORX=1TOC
1920 AN$=AN$+MID$(EN$(X),1,1)
1930 NEXTX
1940 RETURN
1995 REM *** FIX ONE FIELD
2000 POKE850,CU(FP,1):POKE851,CU(FP,2):SYS828
2003 AZ=CU(FP,3):CR$(CP,FP)=LEFT$(UN$,AZ):PRINT"[151]";CR$(CP,FP):SYS828
2010 PRINT"?[157][151]";
2020 GOSUB1800
2030 CR$(CP,FP)=AN$
2040 GOSUB2100:PRINT"CHANGE MADE[151]":FC=FC+1
2050 RETURN
2095 REM **** POKE IN PROCESS MSG
2100 POKE850,21:POKE851,7:SYS828
2110 RETURN
2150 POKE850,21:POKE851,7:SYS828
2160 PRINT" [155]"
2170 RETURN
4000 GOSUB1000
4010 IF RC=0 THEN CP=1:GOSUB800:GOSUB1400:GOSUB2100:PRINT"NO FILE"
4020 IF RC>0 THEN CP=1:GOSUB1400
4030 IF F$="[139]"THEN GOSUB2150:GOSUB2100:PRINT"BKUP LOADED - USE MAIN DISK"
4200 GOSUB9200:GOSUB2150
4210 IF K$="S" THEN GOSUB400
4220 IF K$="K" THEN GOSUB600:GOTO4200
4230 IF K$="Q" THEN 4700
4240 IF K$<>"N" THEN 4280
4250 IF CP+1>RC THEN GOSUB2100:PRINT"TOO FAR":GOTO4200
4260 CP=CP+1:GOSUB1400
4270 GOTO4200
4280 IF K$<>"B"THEN4310
4285 IF CP-1<1 THEN GOSUB2100:PRINT"TOO FAR[151]":GOTO4200
4290 CP=CP-1:GOSUB1400
4300 GOTO4200
4310 IF K$<>"A" THEN 4400
4340 CP=RC+1:GOSUB800
4350 GOSUB1400:REM FILL SCREEN
4360 GOSUB1600:REM MASS ENTRY
4370 RC=RC+1:GOTO4200
4400 IF K$<>"C" THEN 4200
4410 POKE850,23:POKE851,2:SYS828
4420 PRINT"N[146]AME P[146]AR R[146]ATING D[146]IST 1-18[146] Q[146]UIT"
4430 GOSUB9000
4435 GOSUB2150
4440 IF A$<>"Q"THEN4490
4450 POKE850,23:POKE851,2:SYS828
4460 PRINT" "
4470 GOTO4200
4490 IF A$="N"THEN FP=1:GOTO4570
4500 IF A$="P" THEN FP=2:GOTO4570
4510 IF A$="R" THEN FP=3:GOTO4570
4520 IF A$="D" THEN FP=4:GOTO4570
4530 IF A$>"0"ANDA$<"19" THEN 4560
4540 GOTO4430
4560 FP=VAL(A$)+4
4570 GOSUB2000: REM FIX 1 FIELD
4580 GOTO4430
4700 IF FC=0THEN4720
4705 IF SV$="Y"THEN4720
4710 GOSUB2100:PRINT"NO SAVE -- 'Q' AGAIN TO VERIFY":SV$="Y":GOTO4200
4720 PRINT"[147][151]END OF GOLF COURSE PROGRAM":END
8000 PRINT"[147]";TAB(13);"GOLF COURSE"
8010 PRINT"[151]THIS PROGRAM WILL ALLOW YOU TO"
8020 PRINT"STORE INFORMATION ON COURSES USED"
8030 PRINT"IN ESTABLISHING YOUR HANDICAP"
8040 PRINT"YOU WILL NEED TO ENTER THE COURSE"
8050 PRINT"NAME, RATING, AND PAR ON EACH HOLE"
8060 PRINT"IF YOU ENTER LESS THAN THE MAXIMUM"
8070 PRINT"NUMBER OF CHARACTERS FOR AN ENTRY,"
8080 PRINT"USE THE CARRIAGE RETURN."
8090 PRINT"DO NOT ENTER ACTUAL ROUNDS PLAYED"
8100 PRINT"WITH THIS PROGRAM"
8110 PRINT"USE F1 TO DELETE ENTRIES[146]"
8120 PRINT"PRESS F8 TO CREATE A NEW FILE"
8125 PRINT"PRESS F6 TO LOAD BACKUP FILE"
8130 PRINT"[154]OTHER TO LOAD COURSE FILE"
8140 GETF$:IFF$=""THEN8140
8142 IF F$="[139]" THEN PRINT"[129]LOAD BACKUP DISK - HIT A KEY":GOSUB9200
8150 RETURN
9000 A$="":TM=0:POKE198,0
9010 GETZ$:IFZ$=""THEN9010
9020 IF Z$=CHR$(20)THEN 9010
9030 IF Z$=CHR$(13)ANDTM=0THEN 9010
9035 IF Z$=CHR$(13)THEN RETURN
9040 IF Z$="N"ORZ$="Q"ORZ$="P"ORZ$="R"ORZ$="D" THEN A$=Z$:RETURN
9050 TM=TM+1
9060 IF Z$>"0"ANDZ$<"9" THEN 9100
9070 IF Z$="9"ANDTM=1THEN TM=2:GOTO9100
9080 IF Z$="0" AND TM=2 THEN 9100
9090 GOTO9010
9100 A$=A$+Z$:IFTM=2 THEN RETURN
9110 GOTO9010
9200 GETK$:IFK$="" THEN 9200
9210 RETURN
9600 INPUT#15,EN,EM$
9610 IF EN=0OREN=61OREN=62THENRETURN
9620 AB$="Y":RETURN
10000 DATA 5,15,20,7,6,2,7,18,4,7,34,4
10010 DATA 9,10,1,9,23,1,9,36,1
10020 DATA 11,10,1,11,23,1,11,36,1
10030 DATA 13,10,1,13,23,1,13,36,1
10040 DATA 15,10,1,15,23,1,15,36,1
10050 DATA 17,10,1,17,23,1,17,36,1
10060 DATA 19,10,1,19,23,1,19,36,1
10070 DATA 20,24,5
11000 DATA 174,82,03,172,83,03,24,32,240,255,96